<?php
/**
 * Created By virus_cms
 * Author: Virus
 * Date: 2020/3/1
 * Time: 14:42
 */

namespace app\admin\validate;


use think\Validate;

class ConfigValidate extends Validate
{
    protected $rule = [
        'config_type'  => 'require',
        'group_id'     => 'require|number|integer',
        'config_name'  => 'require',
        'config_title' => 'require',
        'config_value' => 'require',
    ];

    protected $message = [
        'config_type.require'  => '配置类型不能为空',
        'config_name'          => '配置变量名不能为空',
        'group_id.require'     => '配置组别不能为空',
        'group_id.number'      => '配置组id必须为数字',
        'group_id.integer'     => '配置组id必须为整型',
        'config_title.require' => '配置标题不能为空',
        'config_value.require' => '配置值不能为空',
    ];

    protected $scene = [
        'add' => ['config_type', 'group_id', 'config_name', 'config_title', 'config_value'],
    ];
}